import Taro, {Component} from '@tarojs/taro'
import {View,Text} from '@tarojs/components'

export default class attr_item extends Component {
  constructor(props) {
    super(props)
    this.state = {

    }
  }


  componentDidShow() {



  }
  clickitem(key,i)
  {
     this.props.onAttrClick(key,i);
  }
  render() {
    const itemlist=this.props.itemlist
    const f_key=this.props.f_key
    return (
      <View style={{display: "flex", flexWrap: "wrap", padding: "5px"}}>
        {itemlist&&itemlist.map((item,i)=>{
          let color=item.active==1?"#e02e24":"#999999"
          return( <View key={i} onClick={this.clickitem.bind(this,f_key,i)} style={{margin:"5px",height:"26px",display:"flex",alignItems:"center",border:"solid 1px",borderColor:color,borderRadius:"3px",paddingLeft:"10px",paddingRight:"10px"}}>
            <Text style={{fontSize:"12px",color:color}}>{item.item}</Text>
          </View>)
        })}
      </View>
    )
  }
}


